import { createSlice } from "@reduxjs/toolkit";
export const tokenSlice = createSlice({
	name: "token",
	initialState: {
		token: "",
		refresh_token: ""
	},
	reducers: {
		setToken: (state, action) => {
			state.token = action.payload;
		},
		removeToken: (state) => {
			state.token = "";
		},
		setRefreshToken: (state, action) => {
			state.refresh_token = action.payload;
		},
		removeRefreshToken: (state) => {
			state.refresh_token = "";
		}
	}
});
export const { setToken, removeToken, setRefreshToken, removeRefreshToken } =
	tokenSlice.actions;
export default tokenSlice.reducer;
